'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const {router, controller} = app;

    router.get('/', controller.home.index);
    router.get('/sendMsg', controller.home.sendMsg);


    /*登录模块*/
    router.get('/admin/loginController/index',controller.admin.loginController.index);
    router.post('/admin/loginController/doLogin',controller.admin.loginController.doLogin);
    router.post('/admin/loginController/outLogin',controller.admin.loginController.outLogin);
    router.get('/admin/loginController/verify',controller.admin.loginController.verify);

    /*管理员*/
    router.get('/admin/manageController/list',controller.admin.manageController.list);
    router.post('/admin/manageController/doAdd',controller.admin.manageController.doAdd);
    router.post('/admin/manageController/getRole',controller.admin.manageController.getRole);

    // GoodType
    router.get('/admin/goodsTypeController/list',controller.admin.goodsTypeController.list);
    // goodsCate
    router.get('/admin/goodsCateController/list',controller.admin.goodsCateController.list);
    // router.post('/admin/login', controller.home.login);

    // GoodType
    // router.get('/admin/goodsType/list', controller.admin.goodsType.list);
    // router.post('/admin/goodsType/add', controller.admin.goodsType.add);
    // router.post('/admin/goodsType/edit', controller.admin.goodsType.edit);

    // // GoodsCate
    // router.get('/admin/goodsCate/list', controller.admin.goodsCateController.list);
    // router.post('/admin/goodsCate/add', controller.admin.goodsCateController.add);
    // router.post('/admin/goodsCate/edit', controller.admin.goodsCateController.edit);
    //
    // // upload
    // router.post('/upload/uploadImages', controller.upload.uploadImages);
    // router.post('/upload/uploadFiles', controller.upload.uploadFiles);

};
